<%--
*@Description 
*@Author KingTeng
*@Date 2022/3/9
*@Time 15:56
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>

<%@include file="header.jsp"%><html>
<!DOCTYPE html>
<html lang="en">

<script language="javascript" type="text/javascript">
    function doPrint() {
        document.getElementById('bt').style.display='none';
        bdhtml=window.document.body.innerHTML; //获取当前页的html代码
        sprnstr="<!--startprint-->"; //设置打印开始区域
        eprnstr="<!--endprint-->";//设置打印结束区域
        prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);//从开始代码向后取html
        prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html
        window.document.body.innerHTML=prnhtml;
        window.print();
        document.getElementById('bt').style.display='block';

    }
</script>

<!--startprint-->


<head>
    <meta charset="UTF-8">
    <title>自动化测试报告</title>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
    <h2 style="font-family: Microsoft YaHei">测试报告</h2>
    <p class='attribute'>
        <c:if test="${not empty result}">
            <strong>测试结果 : </strong>${result.confirmresult}
        </c:if>
    </p>
    <style type="text/css" media="screen">
        body  { font-family: Microsoft YaHei,Tahoma,arial,helvetica,sans-serif;padding: 20px;}
        td {text-align:center}
        th {text-align:center}
    </style>
</head>
<body>
<table id='result_table' class="table table-condensed table-bordered table-hover" >
    <colgroup>
        <col align='left' />
        <col align='right' />
        <col align='right' />
        <col align='right' />
    </colgroup>
    <tr id='header_row' class="text-center success" style="font-weight: bold;font-size: 14px;">
        <th width="25%">姓名</th>
        <th width="25%">年龄</th>
        <th width="25%">性别</th>
        <th width="25%">联系方式</th>
    </tr>

    <tr class='failClass warning'>
        <td > ${sessionScope.user.name}</td>
        <td>${sessionScope.user.age}</td>
        <td>${sessionScope.user.sex}</td>
        <td>${sessionScope.user.phone}</td>
    </tr>
</table>
<!-- 执行模块 -->
<p class='attribute'><strong>测试详情 : </strong> 执行结果</p>
<table id='result_table' class="table table-condensed table-bordered table-hover">
    <colgroup>
        <col align='left' />
        <col align='right' />
        <col align='right' />
        <col align='right' />
    </colgroup>
    <tr id='header_row' class="text-center success" style="font-weight: bold;font-size: 14px;">
        <th>订单号</th>
        <th>创建时间</th>
        <th>确认时间</th>
        <th>检测站</th>
        <th>最终结果</th>
    </tr>

    <tr class='failClass warning'>
        <td>${sessionScope.order.ordercode}</td>
        <td>${sessionScope.order.createdate}</td>
        <td>${sessionScope.result.confirmdate}</td>
        <td>${sessionScope.testStand.address}</td>
        <c:if test="${sessionScope.result.confirmresult=='阴'}">
            <td><font color="green">阴性</font></td>
        </c:if>
        <c:if test="${sessionScope.result.confirmresult=='阳'}">
            <td><font color="#FF0000">阳性</font></td>
        </c:if>
        <c:if test="${empty sessionScope.result.confirmresult}">
            <td><font color="#FF0000">未出结果</font></td>
        </c:if>
    </tr>
</table>

    <input type="button" id="bt" onclick="javascript:doPrint()"  style="position: absolute;bottom: 100px;right: 150px" value="打印" />


</body>
</html>

<!--endprint-->
